#pragma once
#include <string>
#include <unordered_set>
#include <vector>
#include <iostream>

template <typename T> std::vector<T> ScanfVector(std::string str, std::unordered_set<char> sp)
{
    std::vector<T> vec;
    std::vector<char> buffer;
    buffer.resize(1024);
    int size = 0;
    for (char c : str)
    {
        if (sp.count(c))
        {
            if (buffer.size() != 0)
            {
                std::string s(buffer.begin(), buffer.end());
                vec.push_back(stod(s));
                buffer.clear();
            }
        }
        else
        {
            buffer.push_back(c);
        }
    }
    return vec;
}

template <typename T>
std::vector<std::vector<T>> Scanf2DMatrix(std::string str, std::vector<char> elementSp, std::vector<char> lineSp)
{
}

template <typename T> void PrintVector(const std::vector<T> &vec)
{
    for (const auto &elem : vec)
    {
        std::cout << elem << ',';
    }
    std::cout << std::endl;
}

template <typename T> void Print2DVector(const std::vector<std::vector<T>> &vec)
{
    for (const auto &row : vec)
    {
        PrintVector(row);
    }
}